﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Data.Common;

namespace Chenxin.Lib.Business.DAL
{
    /// <summary>
    /// 数据访问类t_Contract_Infomation1。
    /// </summary>
    public class t_Contract_Infomation1
    {
        public t_Contract_Infomation1()
        { }
        #region  成员方法

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public static bool Exists(Guid ContractId)
        {
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from t_Contract_Infomation1 where ContractId=@ContractId ");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, ContractId);
            int cmdresult;
            object obj = db.ExecuteScalar(dbCommand);
            if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static void Add(Chenxin.Lib.Business.Entity.t_Contract_Infomation1 model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into t_Contract_Infomation1(");
            strSql.Append("AddTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,AddCityId,AddCityName,AddCompanyId,AddCompanyName,AddDepartmentId,AddDepartmentName,AddUserId,AddUserName,ContractId,ReciveDate,SendDate,PawnDate,ReciveCode,AccptDate,AccptInfo,Bank,LoanAmount,CertificationDpart,CertificationPserson,CertificationDpartId,CertificationPsersonId,Finished,AllSendDate,GetAllSendDate,ContractSendDate,GetContractSendDate,LandSendDate,GetLandSendDate)");

            strSql.Append(" values (");
            strSql.Append("@AddTime,@UpdateCityId,@UpdateCityName,@UpdateCompanyId,@UpdateCompanyName,@UpdateDepartmentId,@UpdateDepartmentName,@UpdateUserId,@UpdateUserName,@UpdateTime,@AddCityId,@AddCityName,@AddCompanyId,@AddCompanyName,@AddDepartmentId,@AddDepartmentName,@AddUserId,@AddUserName,@ContractId,@ReciveDate,@SendDate,@PawnDate,@ReciveCode,@AccptDate,@AccptInfo,@Bank,@LoanAmount,@CertificationDpart,@CertificationPserson,@CertificationDpartId,@CertificationPsersonId,@Finished,@AllSendDate,@GetAllSendDate,@ContractSendDate,@GetContractSendDate,@LandSendDate,@GetLandSendDate)");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "AddTime", DbType.DateTime, model.AddTime);
            db.AddInParameter(dbCommand, "UpdateCityId", DbType.Guid, model.UpdateCityId);
            db.AddInParameter(dbCommand, "UpdateCityName", DbType.AnsiString, model.UpdateCityName);
            db.AddInParameter(dbCommand, "UpdateCompanyId", DbType.Guid, model.UpdateCompanyId);
            db.AddInParameter(dbCommand, "UpdateCompanyName", DbType.AnsiString, model.UpdateCompanyName);
            db.AddInParameter(dbCommand, "UpdateDepartmentId", DbType.Guid, model.UpdateDepartmentId);
            db.AddInParameter(dbCommand, "UpdateDepartmentName", DbType.AnsiString, model.UpdateDepartmentName);
            db.AddInParameter(dbCommand, "UpdateUserId", DbType.Guid, model.UpdateUserId);
            db.AddInParameter(dbCommand, "UpdateUserName", DbType.AnsiString, model.UpdateUserName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "AddCityId", DbType.Guid, model.AddCityId);
            db.AddInParameter(dbCommand, "AddCityName", DbType.AnsiString, model.AddCityName);
            db.AddInParameter(dbCommand, "AddCompanyId", DbType.Guid, model.AddCompanyId);
            db.AddInParameter(dbCommand, "AddCompanyName", DbType.AnsiString, model.AddCompanyName);
            db.AddInParameter(dbCommand, "AddDepartmentId", DbType.Guid, model.AddDepartmentId);
            db.AddInParameter(dbCommand, "AddDepartmentName", DbType.AnsiString, model.AddDepartmentName);
            db.AddInParameter(dbCommand, "AddUserId", DbType.Guid, model.AddUserId);
            db.AddInParameter(dbCommand, "AddUserName", DbType.AnsiString, model.AddUserName);
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, model.ContractId);
            db.AddInParameter(dbCommand, "ReciveDate", DbType.DateTime, model.ReciveDate);
            db.AddInParameter(dbCommand, "SendDate", DbType.DateTime, model.SendDate);
            db.AddInParameter(dbCommand, "PawnDate", DbType.DateTime, model.PawnDate);
            db.AddInParameter(dbCommand, "ReciveCode", DbType.AnsiString, model.ReciveCode);
            db.AddInParameter(dbCommand, "AccptDate", DbType.DateTime, model.AccptDate);
            db.AddInParameter(dbCommand, "AccptInfo", DbType.AnsiString, model.AccptInfo);
            db.AddInParameter(dbCommand, "Bank", DbType.AnsiString, model.Bank);
            db.AddInParameter(dbCommand, "LoanAmount", DbType.AnsiString, model.LoanAmount);
            db.AddInParameter(dbCommand, "CertificationDpart", DbType.AnsiString, model.CertificationDpart);
            db.AddInParameter(dbCommand, "CertificationPserson", DbType.AnsiString, model.CertificationPserson);
            db.AddInParameter(dbCommand, "CertificationDpartId", DbType.Guid, model.CertificationDpartId);
            db.AddInParameter(dbCommand, "CertificationPsersonId", DbType.Guid, model.CertificationPsersonId);
            db.AddInParameter(dbCommand, "Finished", DbType.Boolean, model.Finished);
            db.AddInParameter(dbCommand, "AllSendDate", DbType.DateTime, model.AllSendDate);
            db.AddInParameter(dbCommand, "GetAllSendDate", DbType.DateTime, model.GetAllSendDate);
            db.AddInParameter(dbCommand, "ContractSendDate", DbType.DateTime, model.ContractSendDate);
            db.AddInParameter(dbCommand, "GetContractSendDate", DbType.DateTime, model.GetContractSendDate);
            db.AddInParameter(dbCommand, "LandSendDate", DbType.DateTime, model.LandSendDate);
            db.AddInParameter(dbCommand, "GetLandSendDate", DbType.DateTime, model.GetLandSendDate);
            db.ExecuteNonQuery(dbCommand);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static void Update(Chenxin.Lib.Business.Entity.t_Contract_Infomation1 model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update t_Contract_Infomation1 set ");
            strSql.Append("AddTime=@AddTime,");
            strSql.Append("UpdateCityId=@UpdateCityId,");
            strSql.Append("UpdateCityName=@UpdateCityName,");
            strSql.Append("UpdateCompanyId=@UpdateCompanyId,");
            strSql.Append("UpdateCompanyName=@UpdateCompanyName,");
            strSql.Append("UpdateDepartmentId=@UpdateDepartmentId,");
            strSql.Append("UpdateDepartmentName=@UpdateDepartmentName,");
            strSql.Append("UpdateUserId=@UpdateUserId,");
            strSql.Append("UpdateUserName=@UpdateUserName,");
            strSql.Append("UpdateTime=@UpdateTime,");
            strSql.Append("AddCityId=@AddCityId,");
            strSql.Append("AddCityName=@AddCityName,");
            strSql.Append("AddCompanyId=@AddCompanyId,");
            strSql.Append("AddCompanyName=@AddCompanyName,");
            strSql.Append("AddDepartmentId=@AddDepartmentId,");
            strSql.Append("AddDepartmentName=@AddDepartmentName,");
            strSql.Append("AddUserId=@AddUserId,");
            strSql.Append("AddUserName=@AddUserName,");
            strSql.Append("ReciveDate=@ReciveDate,");
            strSql.Append("SendDate=@SendDate,");
            strSql.Append("PawnDate=@PawnDate,");
            strSql.Append("ReciveCode=@ReciveCode,");
            strSql.Append("AccptDate=@AccptDate,");
            strSql.Append("AccptInfo=@AccptInfo,");
            strSql.Append("Bank=@Bank,");
            strSql.Append("LoanAmount=@LoanAmount,");
            strSql.Append("CertificationDpart=@CertificationDpart,");
            strSql.Append("CertificationPserson=@CertificationPserson,");
            strSql.Append("CertificationDpartId=@CertificationDpartId,");
            strSql.Append("CertificationPsersonId=@CertificationPsersonId,");
            strSql.Append("Finished=@Finished,");
            strSql.Append("AllSendDate=@AllSendDate,");
            strSql.Append("GetAllSendDate=@GetAllSendDate,");
            strSql.Append("ContractSendDate=@ContractSendDate,");
            strSql.Append("GetContractSendDate=@GetContractSendDate,");
            strSql.Append("LandSendDate=@LandSendDate,");
            strSql.Append("GetLandSendDate=@GetLandSendDate");
            strSql.Append(" where ContractId=@ContractId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "AddTime", DbType.DateTime, model.AddTime);
            db.AddInParameter(dbCommand, "UpdateCityId", DbType.Guid, model.UpdateCityId);
            db.AddInParameter(dbCommand, "UpdateCityName", DbType.AnsiString, model.UpdateCityName);
            db.AddInParameter(dbCommand, "UpdateCompanyId", DbType.Guid, model.UpdateCompanyId);
            db.AddInParameter(dbCommand, "UpdateCompanyName", DbType.AnsiString, model.UpdateCompanyName);
            db.AddInParameter(dbCommand, "UpdateDepartmentId", DbType.Guid, model.UpdateDepartmentId);
            db.AddInParameter(dbCommand, "UpdateDepartmentName", DbType.AnsiString, model.UpdateDepartmentName);
            db.AddInParameter(dbCommand, "UpdateUserId", DbType.Guid, model.UpdateUserId);
            db.AddInParameter(dbCommand, "UpdateUserName", DbType.AnsiString, model.UpdateUserName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "AddCityId", DbType.Guid, model.AddCityId);
            db.AddInParameter(dbCommand, "AddCityName", DbType.AnsiString, model.AddCityName);
            db.AddInParameter(dbCommand, "AddCompanyId", DbType.Guid, model.AddCompanyId);
            db.AddInParameter(dbCommand, "AddCompanyName", DbType.AnsiString, model.AddCompanyName);
            db.AddInParameter(dbCommand, "AddDepartmentId", DbType.Guid, model.AddDepartmentId);
            db.AddInParameter(dbCommand, "AddDepartmentName", DbType.AnsiString, model.AddDepartmentName);
            db.AddInParameter(dbCommand, "AddUserId", DbType.Guid, model.AddUserId);
            db.AddInParameter(dbCommand, "AddUserName", DbType.AnsiString, model.AddUserName);
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, model.ContractId);
            db.AddInParameter(dbCommand, "ReciveDate", DbType.DateTime, model.ReciveDate);
            db.AddInParameter(dbCommand, "SendDate", DbType.DateTime, model.SendDate);
            db.AddInParameter(dbCommand, "PawnDate", DbType.DateTime, model.PawnDate);
            db.AddInParameter(dbCommand, "ReciveCode", DbType.AnsiString, model.ReciveCode);
            db.AddInParameter(dbCommand, "AccptDate", DbType.DateTime, model.AccptDate);
            db.AddInParameter(dbCommand, "AccptInfo", DbType.AnsiString, model.AccptInfo);
            db.AddInParameter(dbCommand, "Bank", DbType.AnsiString, model.Bank);
            db.AddInParameter(dbCommand, "LoanAmount", DbType.AnsiString, model.LoanAmount);
            db.AddInParameter(dbCommand, "CertificationDpart", DbType.AnsiString, model.CertificationDpart);
            db.AddInParameter(dbCommand, "CertificationPserson", DbType.AnsiString, model.CertificationPserson);
            db.AddInParameter(dbCommand, "CertificationDpartId", DbType.Guid, model.CertificationDpartId);
            db.AddInParameter(dbCommand, "CertificationPsersonId", DbType.Guid, model.CertificationPsersonId);
            db.AddInParameter(dbCommand, "Finished", DbType.Boolean, model.Finished);
            db.AddInParameter(dbCommand, "AllSendDate", DbType.DateTime, model.AllSendDate);
            db.AddInParameter(dbCommand, "GetAllSendDate", DbType.DateTime, model.GetAllSendDate);
            db.AddInParameter(dbCommand, "ContractSendDate", DbType.DateTime, model.ContractSendDate);
            db.AddInParameter(dbCommand, "GetContractSendDate", DbType.DateTime, model.GetContractSendDate);
            db.AddInParameter(dbCommand, "LandSendDate", DbType.DateTime, model.LandSendDate);
            db.AddInParameter(dbCommand, "GetLandSendDate", DbType.DateTime, model.GetLandSendDate);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public static void Delete(Guid ContractId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from t_Contract_Infomation1 ");
            strSql.Append(" where ContractId=@ContractId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, ContractId);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Contract_Infomation1 GetModel(Guid ContractId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select AddTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,AddCityId,AddCityName,AddCompanyId,AddCompanyName,AddDepartmentId,AddDepartmentName,AddUserId,AddUserName,ContractId,ReciveDate,SendDate,PawnDate,ReciveCode,AccptDate,AccptInfo,Bank,LoanAmount,CertificationDpart,CertificationPserson,CertificationDpartId,CertificationPsersonId,Finished,AllSendDate,GetAllSendDate,ContractSendDate,GetContractSendDate,LandSendDate,GetLandSendDate from t_Contract_Infomation1 ");
            strSql.Append(" where ContractId=@ContractId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, ContractId);
            Chenxin.Lib.Business.Entity.t_Contract_Infomation1 model = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select AddTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,AddCityId,AddCityName,AddCompanyId,AddCompanyName,AddDepartmentId,AddDepartmentName,AddUserId,AddUserName,ContractId,ReciveDate,SendDate,PawnDate,ReciveCode,AccptDate,AccptInfo,Bank,LoanAmount,CertificationDpart,CertificationPserson,CertificationDpartId,CertificationPsersonId,Finished,AllSendDate,GetAllSendDate,ContractSendDate,GetContractSendDate,LandSendDate,GetLandSendDate ");
            strSql.Append(" FROM t_Contract_Infomation1 ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            return db.ExecuteDataSet(CommandType.Text, strSql.ToString());
        }

        /*
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public static DataSet GetList(int PageSize,int PageIndex,string strWhere)
        {
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetStoredProcCommand("UP_GetRecordByPage");
            db.AddInParameter(dbCommand, "tblName", DbType.AnsiString, "t_Contract_Infomation1");
            db.AddInParameter(dbCommand, "fldName", DbType.AnsiString, "ID");
            db.AddInParameter(dbCommand, "PageSize", DbType.Int32, PageSize);
            db.AddInParameter(dbCommand, "PageIndex", DbType.Int32, PageIndex);
            db.AddInParameter(dbCommand, "IsReCount", DbType.Boolean, 0);
            db.AddInParameter(dbCommand, "OrderType", DbType.Boolean, 0);
            db.AddInParameter(dbCommand, "strWhere", DbType.AnsiString, strWhere);
            return db.ExecuteDataSet(dbCommand);
        }*/

        /// <summary>
        /// 获得数据列表（比DataSet效率高，推荐使用）
        /// </summary>
        public static List<Chenxin.Lib.Business.Entity.t_Contract_Infomation1> GetListArray(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select AddTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,AddCityId,AddCityName,AddCompanyId,AddCompanyName,AddDepartmentId,AddDepartmentName,AddUserId,AddUserName,ContractId,ReciveDate,SendDate,PawnDate,ReciveCode,AccptDate,AccptInfo,Bank,LoanAmount,CertificationDpart,CertificationPserson,CertificationDpartId,CertificationPsersonId,Finished,AllSendDate,GetAllSendDate,ContractSendDate,GetContractSendDate,LandSendDate,GetLandSendDate ");
            strSql.Append(" FROM t_Contract_Infomation1 ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<Chenxin.Lib.Business.Entity.t_Contract_Infomation1> list = new List<Chenxin.Lib.Business.Entity.t_Contract_Infomation1>();
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                while (dataReader.Read())
                {
                    list.Add(ReaderBind(dataReader));
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return list;
        }


        /// <summary>
        /// 对象实体绑定数据
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Contract_Infomation1 ReaderBind(IDataReader dataReader)
        {
            Chenxin.Lib.Business.Entity.t_Contract_Infomation1 model = new Chenxin.Lib.Business.Entity.t_Contract_Infomation1();
            object ojb;
            ojb = dataReader["AddTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddTime = (DateTime)ojb;
            }
            ojb = dataReader["UpdateCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateCityId = new Guid(ojb.ToString());
            }
            model.UpdateCityName = dataReader["UpdateCityName"].ToString();
            ojb = dataReader["UpdateCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateCompanyId = new Guid(ojb.ToString());
            }
            model.UpdateCompanyName = dataReader["UpdateCompanyName"].ToString();
            ojb = dataReader["UpdateDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateDepartmentId = new Guid(ojb.ToString());
            }
            model.UpdateDepartmentName = dataReader["UpdateDepartmentName"].ToString();
            ojb = dataReader["UpdateUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateUserId = new Guid(ojb.ToString());
            }
            model.UpdateUserName = dataReader["UpdateUserName"].ToString();
            ojb = dataReader["UpdateTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateTime = (DateTime)ojb;
            }
            ojb = dataReader["AddCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddCityId = new Guid(ojb.ToString());
            }
            model.AddCityName = dataReader["AddCityName"].ToString();
            ojb = dataReader["AddCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddCompanyId = new Guid(ojb.ToString());
            }
            model.AddCompanyName = dataReader["AddCompanyName"].ToString();
            ojb = dataReader["AddDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddDepartmentId = new Guid(ojb.ToString());
            }
            model.AddDepartmentName = dataReader["AddDepartmentName"].ToString();
            ojb = dataReader["AddUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddUserId = new Guid(ojb.ToString());
            }
            model.AddUserName = dataReader["AddUserName"].ToString();
            ojb = dataReader["ContractId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ContractId = new Guid(ojb.ToString());
            }
            ojb = dataReader["ReciveDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ReciveDate = (DateTime)ojb;
            }
            ojb = dataReader["SendDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.SendDate = (DateTime)ojb;
            }
            ojb = dataReader["PawnDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.PawnDate = (DateTime)ojb;
            }
            model.ReciveCode = dataReader["ReciveCode"].ToString();
            ojb = dataReader["AccptDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AccptDate = (DateTime)ojb;
            }
            model.AccptInfo = dataReader["AccptInfo"].ToString();
            model.Bank = dataReader["Bank"].ToString();
            model.LoanAmount = dataReader["LoanAmount"].ToString();
            model.CertificationDpart = dataReader["CertificationDpart"].ToString();
            model.CertificationPserson = dataReader["CertificationPserson"].ToString();
            ojb = dataReader["CertificationDpartId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CertificationDpartId = new Guid(ojb.ToString());
            }
            ojb = dataReader["CertificationPsersonId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CertificationPsersonId = new Guid(ojb.ToString());
            }
            ojb = dataReader["Finished"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Finished = (bool)ojb;
            }
            ojb = dataReader["AllSendDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AllSendDate = (DateTime)ojb;
            }
            ojb = dataReader["GetAllSendDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetAllSendDate = (DateTime)ojb;
            }
            ojb = dataReader["ContractSendDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ContractSendDate = (DateTime)ojb;
            }
            ojb = dataReader["GetContractSendDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetContractSendDate = (DateTime)ojb;
            }
            ojb = dataReader["LandSendDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.LandSendDate = (DateTime)ojb;
            }
            ojb = dataReader["GetLandSendDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetLandSendDate = (DateTime)ojb;
            }
            return model;
        }

        #endregion  成员方法
    }
}

